﻿@using Abp.MultiTenancy
@using MyCompanyName.AbpZeroTemplate.Authorization
@using MyCompanyName.AbpZeroTemplate.Web.Areas.AppAreaName.Startup
@model MyCompanyName.AbpZeroTemplate.Web.Areas.AppAreaName.Models.Languages.LanguagesIndexViewModel
@{
    ViewBag.CurrentPageName = AppAreaNamePageNames.Common.Languages;
}

@section Scripts
{
    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/language-list.js" asp-append-version="true"></script>
}

<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
    <abp-page-subheader title="@L("Languages")" description="@L("LanguagesHeaderInfo")">
        @if (IsGranted(AppPermissions.Pages_Administration_Languages_Create) && AbpSession.MultiTenancySide == MultiTenancySides.Host)
        {
            <button id="CreateNewLanguageButton" class="btn btn-primary">
                <i class="fa fa-plus"></i> @L("CreateNewLanguage")
            </button>
        }
    </abp-page-subheader>

    <div class="@(await GetContainerClass())">
        <div class="card card-custom gutter-b">
            <div class="card-body">
                <div class="align-items-center">
                    <table id="LanguagesTable" class="display table table-separate table-head-custom no-footer dtr-inline dt-responsive nowrap">
                        <thead>
                        <tr>
                            <th></th>
                            <th>@L("Actions")</th>
                            <th>@L("Name")</th>
                            <th>@L("Code")</th>
                            <th>@L("Default")</th>
                            <th>@L("IsEnabled")</th>
                            <th>@L("CreationTime")</th>
                        </tr>
                        </thead>
                    </table>
                    @if (Model.IsTenantView)
                    {
                        <p class="margin-top-20">
                            @("* " + L("CanNotEditOrDeleteDefaultLanguages"))
                        </p>
                    }
                </div>
            </div>
        </div>
    </div>
</div>
